package com.ktwlsoft.archivemanage.payload.question;

import com.google.common.base.CaseFormat;
import com.ktwlsoft.archivemanage.domain.dao.entity.Question;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * @author JokerMo
 * @version 1.0
 * @date 2019/12/13 16:57
 */
@Getter
@Setter
public class QuestionPageRequest {
    @ApiModelProperty("分页")
    private Integer pn;

    @ApiModelProperty("分页大小")
    private Integer pageSize;

    @ApiModelProperty("业务来源")
    private Question.BusinessFrom businessFrom;

    @ApiModelProperty("关键字")
    private String keywords;

    @ApiModelProperty("排序字段")
    private String orderField;

    @ApiModelProperty("排序方式：descend 倒序，ascend 正序")
    private String orderType;

    public void setOrderField(String orderField) {
        this.orderField = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, orderField);
    }
}
